package com.git.bds.mr.doctor.convert;

import com.git.bds.mr.doctor.model.dto.RecordModifyDTO;
import com.git.bds.mr.records.model.domain.Records;
import com.git.bds.mr.records.model.dto.RecordAddDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * @author 成大事
 * @since 2022/9/27 14:58
 */
@Mapper
public interface DoctorRecordConvert {
    DoctorRecordConvert INSTANCE = Mappers.getMapper(DoctorRecordConvert.class);

    /**
     * 记录
     *
     * @param recordAddDTO 记录添加数据到
     * @param hospitalId   医院id
     * @param doctorId     医生id
     * @param patientId    患者id
     * @return {@link Records}
     */
    @Mapping(source = "hospitalId",target = "hospitalId")
    @Mapping(source = "doctorId",target = "doctorId")
    @Mapping(source = "patientId",target = "patientId")
    Records toRecord(Long hospitalId,Long doctorId,Long patientId,RecordAddDTO recordAddDTO);


    /**
     * 记录
     *
     * @param recordDTO 记录数据到
     * @return {@link Records}
     */
    Records toRecord(RecordModifyDTO recordDTO);
}
